package ai.zixing.service;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;

/**
 * @author zixing
 */
@Slf4j
public abstract class AbstractDataAnalyseManager implements AnalyseService {

    @Async("customizeThreadPoolBean")
    @SneakyThrows
    @Override
    public void analyseHandle(String start, String end) {
        Thread.sleep(2 * 1000);
        log.info(getDataType() + "在 customizeThreadPoolBean 线程池" + Thread.currentThread().getName());
    }

    @SneakyThrows
    @Async
    @Override
    public void analyseHandle(String end) {
        Thread.sleep(3 * 1000);
        log.info(getDataType() + "在 MyDefinedThreadPool 线程池" + Thread.currentThread().getName());
    }
}
